<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var str='123456789'
        // var str2='1-2-3-4-5-6-7'
        // var str3='aBcDeFgH'
        // //split   打散
        // //将字符串用参数切割 ，打散成数组
        // console.log(str.split(''));
        // console.log(str2.split(''));
        // console.log(str2.split('-'));

        // //subStr
        // console.log(str.substr(1,3));

        // //全部小写
        // console.log(str3.toLowerCase(str3));
        // //全部大写
        // console.log(str3.toUpperCase(str3))


        var str='get-element-by-id'
        var copyStr='';
        var strArr=str.split('-')
       // console.log(str1.split('-').join(''));

       for(var i=0;i<strArr.length;i++){
          // console.log(strArr[i])git commit -m "第一次提交"
        //    console.log(strArr[i].slice(0,1))
        //    console.log(strArr[i].slice(1))

           console.log(strArr[i].slice(0,1).toUpperCase()+strArr[i].slice(1))
           strArr[i]=strArr[i].slice(0,1).toUpperCase()+strArr[i].slice(1)
        }
        copyStr=strArr.join('');
        console.log(strArr);
        console.log(copyStr.slice(0,1).toLowerCase()+copyStr.slice(1))
  
       


    </script>
</body>
</html>